#pragma once
     
// ThinWorkerThread.h: interface for the CThinWorkerThread class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(THINWORKERTHREAD_H)
#define THINWORKERTHREAD_H

#pragma comment(lib,"Winmm.lib")

//##ModelId=4396837702BC
class CThinWorkerThread  
{
public:
	BOOL Suspend();
	//##ModelId=4396837702C8
	BOOL	StartThread();
	//##ModelId=4396837702C9
    void	WaitForExit(DWORD	dwTimeOut=2000);
	//##ModelId=4396837702CB
	void	Terminate();
	//##ModelId=4396837702CC
	BOOL	Resume();
	//##ModelId=4396837702CD
	void	ExitThread(){m_bRepeat = FALSE;}
	//##ModelId=4396837702CE
	BOOL	IsRepeat(){	return	m_bRepeat;}

	//##ModelId=4396837702D8
	HANDLE	GetThreadHandle(){return m_hThread;}
	//##ModelId=4396837702D9
	DWORD&	GetExitCode(){return m_dwExitCode;}

	//##ModelId=4396837702DA
    virtual DWORD ThreadMemberFunc();
	//##ModelId=4396837702DC
    static DWORD WINAPI ThreadFunc(LPVOID param);

	//##ModelId=4396837702DF
	CThinWorkerThread(LPCTSTR lpThreadName=NULL);
	//##ModelId=4396837702E1
	virtual ~CThinWorkerThread();

private:
	//##ModelId=4396837702E3
	BOOL	m_bSuspend;
	//##ModelId=4396837702E4
	BOOL	m_bRepeat;

	//##ModelId=4396837702E5
	TCHAR	m_chThreadName[100];

	//##ModelId=4396837702E8
    HANDLE  m_hThread;
	//##ModelId=4396837702E9
    DWORD   m_ThreadId;
	//##ModelId=4396837702EA
	DWORD	m_dwExitCode;

};

#endif // !defined(THINWORKERTHREAD_H)
